package com.doit.day02

object _01_拉链 {
  def main(args: Array[String]): Unit = {
    //zip
    val list1: List[Int] = List(1, 2)

    val list2: List[String] = List("hadoop", "hive", "hbase")

    val tuples: List[(Int, String)] = list1.zip(list2)

    tuples.foreach(println)

    //zipWithIndex
    val index: List[(String, Int)] = list2.zipWithIndex
    index.foreach(println)

    /**
     * (hadoop,0)
       (hive,1)
       (hbase,2)
     */





  }
}
